﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MvcEngine.Core.Services;
using System.Web.Routing;
using MvcEngine.Mvc.Extensions;

namespace MvcEngine.ItemList.Components.Services
{
    public class ItemListModuleService : IModuleService
    {
        #region IModuleService Members

        public virtual void RegisterRoutes(RouteCollection routes)
        {
            routes.MapMvcEngineRoute(
                "ItemListNew",
                "{pageName}/ItemList/New",
                new { controller = "Home", action = "Index", actionName = "New", controlKey = "ItemList" }
            );

            routes.MapMvcEngineRoute(
                "ItemListSaveNew",
                "{pageName}/ItemList/SaveNew",
                new { controller = "Home", action = "Index", actionName = "New", controlKey = "ItemList" }
            );

            routes.MapMvcEngineRoute(
                "ItemListEdit",
                "{pageName}/ItemList/Edit/{id}",
                new { controller = "Home", action = "Index", actionName = "Edit", controlKey = "ItemList" }
            );

            routes.MapMvcEngineRoute(
                "ItemListSave",
                "{pageName}/ItemList/Save/{id}",
                new { controller = "Home", action = "Index", actionName = "Edit", controlKey = "ItemList" }
            );

            routes.MapMvcEngineRoute(
                "ItemListDetails",
                "{pageName}/ItemList/{id}",
                new { controller = "Home", action = "Index", actionName = "Details", controlKey = "ItemList" }
            );

            routes.MapMvcEngineRoute(
                "ItemListDelete",
                "{pageName}/ItemList/Delete/{id}",
                new { controller = "Home", action = "Index", actionName = "Delete", controlKey = "ItemList" }
            );
        } 

        public void RegisterActionFilters()
        {
            //throw new NotImplementedException();
        }

        public void RegisterCommands()
        {
            throw new NotImplementedException();
        }

        public void DeleteControlFromPage(int pageContentId, Guid controlId)
        {
            throw new NotImplementedException();
        }

        public void RegisterModelBinders(System.Web.Mvc.ModelBinderDictionary binders)
        {

        }

        #endregion
    }
}
